package com.yami.shop.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.bean.model.Comment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.param.CommentParam;
import com.yami.shop.bean.param.PostsQuery;
import com.yami.shop.bean.vo.CommentVO;

import java.util.stream.Stream;

/**
 * <p>
 * 用于存储用户对动态的评论 服务类
 * </p>
 *
 * @author EXiaoKe
 * @since 2025-04-14
 */
public interface CommentService extends IService<Comment> {

    IPage<CommentVO> getPostPage(Page<Comment> page, PostsQuery query);

    /**
     * 获取评论列表
     * @param postId
     * @return
     */
    Stream<Comment> getCommentsByPost(Long postId);

    /**
     * 添加评论
     * @param param
     * @return
     */
    Long addComment(CommentParam param);
}
